public class FatherTask implements Runnable{
    private Father father;
    private int num;
    public FatherTask (Father father, int num){
        this.father = father;
        this.num = num;
    }
    @Override
    public void run() {
        int i =0;
        while(i < this.num){
            i++;
            this.father.earning(10);
            try{
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
